package com.edu.gateway.filter;

import com.edu.gateway.base.GatewayHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class CheckStatusGatewayFilterFactory extends AbstractGatewayFilterFactory {
    @Override
    public GatewayFilter apply(Object config) {
        return (exchange, chain) -> {
            log.info("gateway filter uri:{}",exchange.getRequest().getPath());
            return GatewayHelper.ok(exchange);
        };
    }
}